<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mass/mass/Mass_OutIns.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/mass/Mass_OutIns.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'Mass_OutInspection_ID',
            footer: "Foots",
            cnName: '出货检验单',
            name: 'Mass_OutIns',
            url: "/Mass_OutIns/",
            sortName: "Mass_OutInspection_ID"
        });
        const editFormFields = ref(
            {
                "Mass_OutInspection_Code": "",
                "Mass_OutInspection_Name": "",
                "Mass_OutInspection_ProModel": "",
                "Mass_OutInspection_ProCode": "",
                "Mass_OutInspection_ProName": "",
                "Mass_OutInspection_DisNum": "",
                "Mass_OutInspection_InspectionNum": "",
                "Mass_OutInspection_ShippingNum": "",
                "Mass_OutInspection_SpeResult": "",
                "Mass_OutInspection_SpeDate": "",
                "Mass_OutInspection_OutDate": "",
                "Mass_OutInspection_Remark": ""
            });
        const editFormOptions = ref([
            [
                { "title": "检验单编码","required": false, "field": "Mass_OutInspection_Code", "type": "text" },
            
                { "title": "检验单名称","required": true,  "field": "Mass_OutInspection_Name", "type": "text" },
                { "title": "备注", "required": true, "field": "Mass_OutInspection_Remark", "type": "textarea" }
            ],
            [
                { "title": "产品", "required": true, "field": "Mass_OutInspection_ProID", "disabled": true, "type": "number", hidden: true },
                { "title": "产品名称","required": true,  "field": "Mass_OutInspection_ProName", "disabled": true },
                { "title": "产品编码","required": true,  "field": "Mass_OutInspection_ProCode", "disabled": true },
                { "title": "规格型号","required": true,  "field": "Mass_OutInspection_ProModel", "disabled": true }
            ],
            [
                { "title": "发货数量","required": true,  "field": "Mass_OutInspection_ShippingNum", "type": "number" },
                { "title": "检测数量","required": true,  "field": "Mass_OutInspection_InspectionNum", "type": "number" },
                { "title": "不合格数量","required": true,  "field": "Mass_OutInspection_DisNum", "type": "number" }
            ],
            [
                { "dataKey": "CheckResult", "data": [], "title": "检测结果", "field": "Mass_OutInspection_SpeResult", "type": "select" },
                { "title": "检测日期","required": true,  "field": "Mass_OutInspection_SpeDate", "type": "date" },
                { "title": "出货日期","required": true,  "field": "Mass_OutInspection_OutDate", "type": "date" }
            ],
        ]);


        const searchFormFields = ref(
            {
                "Mass_OutInspection_Remark": "",
                "Mass_OutInspection_SpeResult": "",
                "Mass_OutInspection_SpeDate": "",
                "Mass_OutInspection_OutDate": "",
                "Mass_OutInspection_DisNum": [null, null],
                "Mass_OutInspection_InspectionNum": [null, null],
                "Mass_OutInspection_ShippingNum": [null, null],
                "Mass_OutInspection_ProModel": "",
                "Mass_OutInspection_ProCode": "",
                "Mass_OutInspection_ProName": "",
                "Mass_OutInspection_Code": "",
                "Mass_OutInspection_Name": ""
            });


        const searchFormOptions = ref([
            [
                { "title": "产品名称", "field": "Mass_OutInspection_ProName", "type": "like" },
                { "title": "检验单编码", "field": "Mass_OutInspection_Code", "type": "like" },
                { "title": "检验单名称", "field": "Mass_OutInspection_Name", "type": "like" }
            ], [
                { "title": "发货数量", "field": "Mass_OutInspection_ShippingNum", "type": "range" },
                { "title": "规格型号", "field": "Mass_OutInspection_ProModel", "type": "like" },
                { "title": "产品编码", "field": "Mass_OutInspection_ProCode", "type": "like" }
            ], [
                { "title": "出货日期", "field": "Mass_OutInspection_OutDate", "type": "date" },
                { "title": "不合格数量", "field": "Mass_OutInspection_DisNum", "type": "range" },
                { "title": "检测数量", "field": "Mass_OutInspection_InspectionNum", "type": "range" }

            ], [
                { "title": "备注", "field": "Mass_OutInspection_Remark", "type": "like" },
                { "dataKey": "CheckResult", "data": [], "title": "检测结果", "field": "Mass_OutInspection_SpeResult", "type": "select" },
                { "title": "检测日期", "field": "Mass_OutInspection_SpeDate", "type": "date" }
            ]]);


        const columns = ref([
            { field: 'Mass_OutInspection_ID', title: '出库检验单主键', type: 'int', width: 80, hidden: true, readonly: true, require: true, align: 'left' },
            { field: 'Mass_OutInspection_Name', title: '检验单名称', type: 'string', sort: true, width: 110, align: 'left',link:true },
            { field: 'Mass_OutInspection_Code', title: '检验单编码', type: 'string', sort: true, width: 120, align: 'left' },
            { field: 'Mass_OutInspection_ProName', title: '产品名称', type: 'string', width: 110, align: 'left' },
            { field: 'Mass_OutInspection_ProCode', title: '产品编码', type: 'string', width: 120, align: 'left' },
            { field: 'Mass_OutInspection_ProModel', title: '规格型号', type: 'string', width: 220, align: 'left' },
            { field: 'Mass_OutInspection_ShippingNum', title: '发货数量', type: 'int', width: 80, align: 'left' },
            { field: 'Mass_OutInspection_InspectionNum', title: '检测数量', type: 'int', width: 80, align: 'left' },
            { field: 'Mass_OutInspection_DisNum', title: '不合格数量', type: 'int', width: 80, align: 'left' },
            { field: 'Mass_OutInspection_OutDate', title: '出货日期', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            { field: 'Mass_OutInspection_SpeDate', title: '检测日期', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            { field: 'Mass_OutInspection_SpeResult', title: '检测结果', type: 'string', bind: { key: 'CheckResult', data: [] }, width: 120, align: 'left' },
            { field: 'Mass_OutInspection_Remark', title: '备注', type: 'string', width: 220, align: 'left' },
            { field: 'CreateDate', title: '创建时间', type: 'datetime', width: 150, align: 'left', sort: true },
            { field: 'Creator', title: '创建人', type: 'string', width: 130, align: 'left' },
            { field: 'CreateID', title: '创建人编号', type: 'int', width: 80, hidden: true, align: 'left' },
            { field: 'ModifyID', title: '修改人编号', type: 'int', width: 80, hidden: true, align: 'left' },
            { field: 'Modifier', title: '修改人', type: 'string', width: 130, align: 'left' },
            { field: 'ModifyDate', title: '修改时间', type: 'datetime', width: 150, align: 'left', sort: true }
        ]);


        const detail = ref({
            cnName: "出货检验单-检验项",
            table: "Mass_OutIns_Detltems",
            columns: [
                { field: 'Mass_OutInspection_CheckItemId', title: '出库检验单检测项主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
                { field: 'Mass_OutInspection_ID', title: '出库检验单主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_ID', title: '检测项主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_Name', title: '检测项名称', type: 'string', width: 120, align: 'left', sort: true },
                { field: 'Mass_OutIns_DetectionItems_Code', title: '检测项编码', type: 'string', width: 120, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_Type', title: '检测项类型', type: 'string', bind: { key: 'QCDefectType', data: [] }, width: 180, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_Tool', title: '检测工具', type: 'string', width: 180, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_Require', title: '检测要求', type: 'string', width: 180, align: 'left' },
                { field: 'Mass_OutIns_DetectionItems_StandardValue', title: '标准值', type: 'decimal', width: 110, align: 'left' },
                { field: 'Mass_OutIns_ErrorUp', title: '误差上限', type: 'decimal', width: 110, align: 'left' },
                { field: 'Mass_OutIns_ErrorDown', title: '误差下限', type: 'decimal', width: 110, align: 'left' },
                { field: 'Mass_OutIns_FatelNum', title: '致命缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
                { field: 'Mass_OutIns_SevereNum', title: '严重缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
                { field: 'Mass_OutIns_SlightNum', title: '轻微缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
                { field: 'Mass_OutIns_Remark', title: '备注', type: 'string', width: 220, edit: { type: 'text' }, align: 'left' },
                { field: 'CreateID', title: '创建人编号', type: 'int', width: 80, hidden: true, align: 'left' },
                { field: 'Creator', title: '创建人', type: 'string', width: 130, align: 'left' },
                { field: 'CreateDate', title: '创建时间', type: 'datetime', width: 110, align: 'left', sort: true },
                { field: 'ModifyID', title: '修改人编号', type: 'int', width: 80, hidden: true, align: 'left' },
                { field: 'Modifier', title: '修改人', type: 'string', width: 130, hidden: true, align: 'left' },
                { field: 'ModifyDate', title: '修改时间', type: 'datetime', width: 110, hidden: true, align: 'left', sort: true }
            ],
            sortName: "Mass_OutInspection_CheckItemId",
            key: "Mass_OutInspection_CheckItemId"
        });


        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
